var express = require('express');
var router = express.Router();

/* GET users listing. */
//引入第二层函数
const {
  getAll2,
  create2,
  delete2
}=require("../service/love.js")


/* GET home page. */
// 获取收藏
router.post('/getall', async function (req, res, next) {
  // console.log(req.body);
  
  const result = await getAll2(req.body);
  res.send(result)
});
// 生成收藏
router.post('/create', async function (req, res, next) {
    // console.log(req.body);
    
    const result = await create2(req.body);
    res.send(result)
  });
// 取消收藏
router.delete('/', async function (req, res, next) {
    // console.log(req.body);
    
    const result = await delete2(req.body);
    res.send(result)
  });
module.exports = router;
